rendernodeparser: Add support for reusing textures
authorBenjamin Otte <otte@redhat.com>
Tue, 28 Mar 2023 19:54:26 +0000 (21:54 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 29 Mar 2023 01:53:52 +0000 (03:53 +0200)
commit348a68599a94ab1a04f9234e7e3758665ad8b990
tree2c389ca0a9b20a14faf766a212e75313375e966a
parent8590b1ef118bcc00d3f75efe5ddf9acc89ba9b6f
rendernodeparser: Add support for reusing textures

We extend the syntax for textures from just:
  <url>
to
  [<string>] <url>
  <string>
where the first defines a named texture while the second references a
texture.
Or to give an example:
  texture {
    bounds: 0 0 10 10;
    texture: "foo" url("foo.png");
  }
  texture {
    bounds: 20 0 10 10;
    texture: "foo";
  }
This will draw the texture "foo.png" twice, once at (0,0) and once at
(20,0).

The intended use for this is both shortening generated node files as
well as allowing to write tests that reuse textures, in particular when
mixing them in texture and texture-scale nodes.
gsk/gskrendernodeparser.c